package com.dyzx.hbb.modules.sys.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dyzx.hbb.common.config.MyLambdaQueryWrapper;
import com.dyzx.hbb.modules.sys.entity.SysDictValue;
import com.dyzx.hbb.modules.sys.entity.SysRole;
import com.dyzx.hbb.modules.sys.service.SysRoleService;
import com.dyzx.hbb.modules.sys.mapper.SysRoleMapper;
import com.dyzx.hbb.security.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【sys_role(部门表)】的数据库操作Service实现
* @createDate 2025-04-14 13:29:08
*/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole>
    implements SysRoleService{

    @Override
    public List<Map<String, Object>> findByMiniList() {
        Long organId = SecurityContextHolder.getOrganId();
        MyLambdaQueryWrapper<SysRole> wrapper = new MyLambdaQueryWrapper<>();
        wrapper.select(SysRole::getId,SysRole::getName)
               .select(SysRole::getName).as("label")
               .select(SysRole::getId).as("value");
        wrapper.eq(SysRole::getOrganId, organId);
        return listMaps(wrapper);

    }
}




